using System;

namespace svs.Mobile.BeyondMedia.UiCore.GDI
{
	public struct FontGdi
	{
		private IntPtr	m_hfont;

		public FontGdi(IntPtr hfont)
		{
			m_hfont = hfont;
		}

		public static FontGdi Empty
		{
			get { return (FontGdi) IntPtr.Zero; }
		}

		public bool IsEmpty
		{
			get { return (m_hfont == IntPtr.Zero); }
		}

		public override bool Equals(object obj)
		{
			return ((IntPtr) this == (IntPtr) obj);
		}

		public override int GetHashCode()
		{
			return m_hfont.GetHashCode();
		}


		public static bool operator !=(FontGdi a, FontGdi b)
		{
			return (a.m_hfont != b.m_hfont);
		}

		public static bool operator ==(FontGdi a, FontGdi b)
		{
			return (a.m_hfont == b.m_hfont);
		}

		public static explicit operator IntPtr(FontGdi font)
		{
			return font.m_hfont;
		}

		public static implicit operator FontGdi(IntPtr hfont)
		{
			return new FontGdi(hfont);
		}
	}
}